<div class="profile-comment-card crayons-card mt-2 m:mt-0 mb-2">
  <% if @comments.present? %>
    <% if params[:view] == "comments" %>
      <div class="crayons-card__header">
        <h3 class="crayons-subtitle-2">
          <% if high_number_of_comments?(@user.comments_count) %>
            <%= t("views.users.comments.last.other") %>
          <% else %>
            <%= t("views.users.comments.all.other") %>
          <% end %>
        </h3>
        <div class="crayons-card__actions">
          <a href="<%= @user.path %>" class="crayons-link--branded fs-base">
            <%= t("views.users.comments.view_last.other") %>
          </a>
        </div>
      </div>
    <% else %>
      <div class="crayons-card__header">
        <h3 class="crayons-subtitle-2">
          <%= t("views.users.comments.last.other") %>
        </h3>
      </div>
    <% end %>
  <% end %>
  <% @comments.each do |comment| %>
    <% if comment.commentable.present? && comment.commentable.published && !comment.deleted %>
      <a href="<%= comment.path %>" class="profile-comment-row ">
        <h4 class="fw-bold fs-base m-0 mb-1">
          <%= truncate(comment.commentable.title, length: 75) %>
        </h4>
        <div class="flex items-center fs-s">
          <p class="color-base-80">
            <%= truncate(strip_tags(comment.processed_html), length: 64).html_safe %>
          <p>
          <small class="ml-2 color-base-60 fs-s comment-date whitespace-nowrap">
            <time datetime="<%= comment.decorate.published_timestamp %>"><%= comment.readable_publish_date %></time>
          </small>
        </div>
      </a>
    <% end %>
  <% end %>
  <% if params[:view] != "comments" && high_number_of_comments?(@user.comments_count) %>
    <div class="pt-3 pl-4 pb-3 pr-4">
      <a href="<%= @user.path %>/comments" class="fs-base">
        <%= t("views.users.comments.view_last.other") %>
      </a>
    </div>
  <% elsif params[:view] != "comments" && view_all_comments?(@user.comments_count) %>
    <div class="py-3 px-4">
      <a href="<%= @user.path %>/comments" class="fs-base">
        <%= t("views.users.comments.view_all.other") %>
      </a>
    </div>
  <% end %>
</div>
